import request from '@/utils/request'

/**
 * 获取部门列表接口
 * @return {AxiosPromise<any>}
 */
export function getDepartmentApi() {
  return request.get('/company/department')
}

/**
 * 获取负责人列表
 */

export function getEmployeeSimpleApi() {
  return request.get('/sys/user/simple')
}

/**
 * 新增部门接口
 */

export function addDepartsApi(data) {
  return request.post('/company/department', data)
}

/**
 * 获取部门详情数据
 */
export function getDepartDetailApi(id) {
  return request.get(`/company/department/${id}`)
}

export function updateDepartApi(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}

export function delDepartApi(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
